{\rtf1\ansi\ansicpg936\cocoartf1561\cocoasubrtf600
{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c100000\c100000\c100000;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab20
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardeftab20\partightenfactor0

\f0\fs22 \cf2 \cb3 \expnd0\expndtw0\kerning0
\CocoaLigature0 select * from users order by cdate asc limit 10;\
\
select b.id,b.title,b.pcount,u.name from blog b,users u\
    -> where b.uid=u.id order by b.pcount desc limit 5;\
\
select u.id,u.name,count(b.uid) from users u\
    -> left join blog b on u.id=b.uid and b.flag=1 group by b.uid order by count(b.uid) desc;\
\
 select u.id,u.name,avg(b.pcount) from users u\
    -> left join blog b on u.id=b.uid group by b.uid order by avg(b.pcount) desc limit 3;\
\
delete from users where id in(select * from (select u.id from users u left join blog b on u.id=b.uid and b.flag=1 group by u.id having count(b.uid)=0) as temp);\
}